//package org.karelun.rabbit.rcp.command;
//
//import org.eclipse.gef.commands.Command;
//import org.karelun.rabbit.graph.Connection;
//import org.karelun.rabbit.graph.Shape;
//
//public class ReconnectionCommand extends Command{
//
//	private Connection connection;
//	
//	private Shape newShape;
//	
//	private Shape oldShape;
//	
//	private boolean sourceOrTarget;
//	
//	public ReconnectionCommand(Connection connection) {
//		this.connection=connection;
//	}
//
//	public void setReconnectShape(Shape shape, boolean sourceOrTarget) {
//		this.newShape=shape;
//		this.sourceOrTarget=sourceOrTarget;
//	}
//	
//	@Override
//	public void execute() {
//		if(sourceOrTarget){
//			oldShape=connection.getSourceShape();
//			connection.setSourceShape(newShape);
//		}else{
//			oldShape=connection.getTargetShape();
//			connection.setTargetShape(newShape);
//		}
//	}
//	
//	@Override
//	public void undo() {
//		if(sourceOrTarget){
//			connection.setSourceShape(oldShape);
//		}else{
//			connection.setTargetShape(oldShape);
//		}
//	}
//}
